/**
 * 
 */
package task.manager;

//import static org.junit.Assert;
import junit.framework.Assert;
import junit.framework.TestCase;

//import org.junit.Before;
//import org.junit.Test;

/**
 * @author Aaron
 *
 */
public class CategoryListTest extends TestCase {

	//private static final long serialVersionUID = 1L;
	CategoryList catList;
	Category testCat1;
	Category testCat2;
	
    /**
     * Instantiates variables to be tested.
     */
	public void setUp() {
		catList = new CategoryList();
		testCat1 = new Category("testCat1");
		testCat2 = new Category("testCat2");
	} // End of setUp() method.
	
	/**
	 * Test method for {@link task.manager.CategoryList#addTask(task.manager.Category, task.manager.Task)}.
	 */
	public void testAddTask() {
		
		Assert.assertTrue("CategoryList is not empty after initialization.",catList.getCategoryArray().size()==0);
		catList.addTask(testCat1, new Task("Walk Dog", 0,0,0,new Integer(0),new Integer(0)));
		Assert.assertTrue("New category was not added to empty CategoryList.",catList.contains(testCat1));
		Assert.assertTrue("Category added to empty CategoryList, but new task was not added.",catList.getCategory("testCat1").getTaskList().hasTask("Walk Dog"));
		catList.addTask(testCat1, new Task("Feed Dog",0,0,0,new Integer(0),new Integer(0)));
		Assert.assertTrue("New task was not added to previously existing category.",catList.getCategory("testCat1").getTaskList().hasTask("Feed Dog"));
		catList.addTask(testCat2, new Task("Feed Monkey",0,0,0,new Integer(0),new Integer(0)));
		Assert.assertTrue("New category was not added to CategoryList.",catList.contains(testCat2));
		Assert.assertTrue("New category added to CategoryList, but new task was not added.",catList.getCategory("testCat2").getTaskList().hasTask("Feed Monkey"));
	
	} // End of testAddTask() method.

	/**
	 * Test method for {@link task.manager.CategoryList#getCategory(java.lang.String)}.
	 */
	public void testGetCategory() {
		
		Assert.assertTrue("CategoryList is not empty after initialization.",catList.getCategoryArray().size()==0);
		Assert.assertTrue("Attempt to get non-existant category from empty CategoryList did not return null.",catList.getCategory("testCat1")==null);
		catList.add(testCat1);
		Assert.assertTrue("CategoryList did not correctly add category.",catList.contains(testCat1));
		Assert.assertTrue("Attempt to retrieve non-existant category from CategoryList did not return null.",catList.getCategory("testCat2")==null);
	
	} // End of testGetCategory() method.

} // End of CategoryListTest class.
